package com.ybkj.o2o.zhuanche.mapper;

import com.ybkj.o2o.zhuanche.common.query.Car2Query;
import com.ybkj.o2o.zhuanche.common.query.CarQuery;
import com.ybkj.o2o.zhuanche.entity.Car;
import com.ybkj.o2o.zhuanche.entity.CarCriteria;

import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CarMapper extends BaseMapper<Car, CarCriteria, Long> {

  int deleteByExample(CarCriteria example);

  int deleteByPrimaryKey(Long id);

  int insert(Car record);

  Car selectByPrimaryKey(Long id);

  int updateByPrimaryKeySelective(Car record);

  int updateByPrimaryKey(Car record);

  
  
  List<Car> selectByParams(CarQuery carQuery);

  Long countByParams(CarQuery carQuery);

  List<Car> findByTiaojians(Car2Query car2Query);

  Long countByTiaojians(Car2Query car2Query);

  Car findByCarId(@Param("carId")Long carId, @Param("appKey")String appKey);

  int deleteById(@Param("id")Long id, @Param("appKey")String appKey);

  Car findByNumber(@Param("carNumber")String carNumber, @Param("appKey")String appKey);

  Car findByEmployId(@Param("employId")Long employId, @Param("appKey")String appKey);

  List<Car> findAllByInsuranceTime(@Param("companyId")Long companyId,@Param("appKey")String appKey);

  List<Car> findAllByOverhaulTime(@Param("companyId")Long companyId,@Param("appKey")String appKey);

  Long updateCarTypeId(@Param("carTypeId")Long carTypeId,@Param("appKey") String appKey);
  
  List<Car> findAll(@Param("appKey")String appKey);

  int deleteByCarTypeId(@Param("carTypeId")Long carTypeId, @Param("appKey")String appKey);

  Long findByRentalCompanyId(@Param("rentalCompanyId")Long rentalCompanyId,
      @Param("appKey")String appKey);

  int batchCreate(@Param("carss") List<Car> carss);

  List<Car> findByIds(CarQuery carQuery);

  Long countByIds(CarQuery carQuery);

  List<Car> updateByIds(@Param("ids") Long[] ids, @Param("appKey") String appKey);

  long count(@Param("appKey") String appKey);

  void updateUpStatus(@Param("id") Long id);
}
